import { createRouter, createWebHistory } from "vue-router";
import Home from "@/views/home/index.vue";
import Login from "@/views/login/index.vue";

const routes = [
  {
    path: "/Home",
    name: "Home",
    component: Home,
  },
  {
    path: "/Login",
    name: "Login",
    component: Login,
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

// 在这里添加路由的导航守卫
router.beforeEach((to, from, next) => {
  console.log("Navigating to:", to.path);
  next();
});

router.afterEach((to, from) => {
  console.log("Navigation completed from:", from.path, "to:", to.path);
});

export default router;
